import Vue from 'vue'
import VueRouter from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import About from '@/components/About'
import Login from '@/components/Login'
import baiduMapTest from '@/components/baiduMap'

// 采用懒加载的方式引入组件

//1.安装路由插件
Vue.use(VueRouter);

//2.创建路由对象
const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    }, {
        path: '/about',
        name: 'About',
        component: About
    }, {
        path: '/HelloWorld',
        name: 'HelloWorld',
        component: HelloWorld
    },{
        path: '/baiduMap',
        name: 'baiduMapTest',
        component: baiduMapTest
    }

]
const router = new VueRouter({
    routes,
    mode: "history"
})

//3.导出router
export default router